<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8" />
<title>订单管理</title>
<link rel="stylesheet" type="text/css" href="../Public/jquery-easyui-1.3.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../Public/jquery-easyui-1.3.4/themes/icon.css">
<script type="text/javascript" src="../Public/jquery-easyui-1.3.4/jquery.min.js"></script>
<script type="text/javascript" src="../Public/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){
	$('#mytable').datagrid({
		nowrap: false,
		striped: true,
		url:'<{:U("/OrderInfo/indexjson")}>',
		columns:[[
			{field:'table_id',checkbox:true},
			{field:'table_code',title:'订单编号',width:60,align:"left"},
			{field:'table_status',title:'状态',width:80,align:"center",formatter:function(value){
				if(value=='0'){
					return '新申请';
				}else if(value=='1'){
					return '已审核';
				}else if(value=='-2'){
					return '取消审核';
				}
			}},
			{field:'table_attribute',title:'订单属性',width:80,align:"center",formatter:function(value){
				if (value == '0')
					return '正常';
				else if (value == '1')
					return '补量';
				 
				
			}},
			{field:'table_title',title:'订单标题',width:300,align:"left"},
			{field:'table_brand',title:'所属品牌',width:150,align:"left",formatter:function(value){
				return value.brandname;
			}},
			{field:'table_ordertype',title:'订单分类',width:100,align:"left",formatter:function(value){
				return value.typename;
			}},
			{field:'table_customer',title:'客户',width:300,align:"left",formatter:function(value){
				return value.customername;
			}},
			{field:'table_usernameorder',title:'销售',width:100,align:"left"},
			/*
			{field:'table_usernameorder',title:'销售',width:100,align:"left",formatter:function(value){
				return value.usernameorder;
			}},
			*/
			
			{field:'table_stime',title:'广告排期开始时间',width:100,align:"left"},
			{field:'table_etime',title:'广告排期结束时间',width:100,align:"left"},
			{field:'table_username',title:'申请人',width:100,align:"left"},
			{field:'table_pubdate',title:'申请时间',width:100,align:"left"},
			{field:'table_editdate',title:'修改时间',width:80,align:"left"},
			{field:'table_verifydate',title:'审核时间',width:80,align:"left"},
			
			{field:'table_order',title:'排期详情',width:120,align:"center",formatter:function(value){
				return '<a href="javascript:showorderinfo(\''+value+'\')">查看</a>';
			}}
		]],
		singleSelect:true,
		fit:true,
		pagination:true,
		pageSize:20,
		toolbar:[{
			text:'新增订单',
			iconCls:'icon-add',
			handler:addAction
		},'-',{
			text:'编辑订单',
			iconCls:'icon-edit',
			handler:editAction
		},'-',{
			text:'审核订单',
			iconCls:'icon-edit',
			handler:editAction2
		},'-',{
			text:'取消审核',
			iconCls:'icon-edit',
			handler:editAction3
		},'-',
		/*
		{
			text:'财务审核',
			iconCls:'icon-edit',
			handler:editAction6
		},'-',{
			text:'取消财务审核',
			iconCls:'icon-edit',
			handler:editAction7
		
		},'-',
		*/
		{
			text:'延期排期订单',
			iconCls:'icon-edit',
			handler:editAction4
		},'-',{
			text:'取消排期延期',
			iconCls:'icon-edit',
			handler:editAction5
		
		},'-',{
			text:'删除订单',
			iconCls:'icon-remove',
			handler:removeAction
		}]
		
	});
	
	
	
	
	//#################初始化客户选择界面##########################
	$('#customerTable').datagrid({
		nowrap: false,
		striped: true,
		columns:[[
			{field:'table_id',title:'客户ID',width:50,align:"center"},
			{field:'table_title',title:'客户名称',width:300,align:"left"},
			{field:'table_shorttitle',title:'客户简称',width:200,align:"left"},
			{field:'table_address',title:'地址',width:350,align:"left"},
			{field:'table_province',title:'省份',width:50,align:"left",formatter:function(value){
				return value.name;
			}},
			{field:'table_contact',title:'联系人',width:50,align:"left"},
			{field:'table_phone',title:'电话',width:100,align:"left"},
			{field:'table_mobile',title:'手机',width:100,align:"left"},
			{field:'table_email',title:'Email',width:100,align:"left"},
			{field:'table_typeid',title:'客户类型',width:50,align:"left",formatter:function(value){
				return value.name;
			}}
		]],
		singleSelect:true,
		fit:true,
		pagination:true,
		onClickRow:function(){
			var selected = $('#customerTable').datagrid('getSelected');
			if(selected){
				$("#form_customerid").val(selected.table_id);
				$("#form_customername").val(selected.table_title);
				$("#searchCustomer").window('close');
			}
		}
	});
	
	
	
	
	
	
	
 });
 

	
function checkSubmit(event){
	if(!$("#myForm").form('validate')){
		$.messager.alert('错误消息','请确保表单信息无误再提交！','error');
	}else if($("#form_usernameorder").val() == 0  ){
		$.messager.alert('错误消息','请先填写销售再提交！','error');
		return;
	}
	/*
	else if($("#formorder input[name='form_channelid[]']").length == 0 || $("#formorder input[name='form_adplaceid[]']").length == 0 || $("#formorder input[name='form_orderdate[]']").length == 0){
		$.messager.alert('错误消息','请先填写排期规则再提交！','error');
		return;
	}
	*/
	else{
		$.post(event.data.action,$('#myForm').serialize() ,function(data){
			if(data.status=='false'){
				$.messager.alert('错误消息',data.info,'error');
			}else{
				closeForm();
				$.messager.alert('提示消息',data.info,'info',function(){
					$("#mytable").datagrid('reload');
				});
			}
		},"json"); 
	}
}
function closeForm(){
	$("#formWindow").window('close');
}
function closeForm2(){
	$("#orderRule").window('close');
}

 //#################系列提交函数##########################
function addAction(){	//添加一个订单
	$("#form_title").val('');
	$("#form_brandid").val('0');
	$("#form_typeid").val('0');
	$("#form_attribute").val('0');
	$("#form_usernameorder").val('0');
	$("#form_customerid").val('');
	$("#form_customername").val('');
	$("#form_trueprice").val('');
	$("#formorder").empty();
	$("#formWindow").window('setTitle','新增订单');
	actionType = false;
	$("#submit").unbind("click");
	$("#submit").bind("click",{action:"<{:U('add')}>"},checkSubmit);
	$("#formWindow").window('open');
	$("#myLayout").layout('resize');
	$('#form_contacts').val('');
	
	
	
	
}
function editAction(){	//编辑一个订单
	var selected = $('#mytable').datagrid('getSelected');
	if(!selected){
		$.messager.alert('错误消息','请先选择一个订单再编辑！','error');
	}else if(selected.table_status=='1' ||selected.table_status=='2' ){
		$.messager.alert('错误消息','该订单已经通过审核，不能再修改！','error');
	}else if (selected.table_status=='3'){
		$.messager.alert('错误消息','该订单已被财务驳回，不能再修改！','error');
	}else{
		$("#form_id").val( selected.table_id );
		$("#form_title").val(selected.table_title);
		$("#form_brandid").val(selected.table_brand.brandid);
		$("#form_typeid").val(selected.table_ordertype.typeid);
		$("#form_usernameorder").val(selected.table_usernameorder);
		$("#form_trueprice").val(selected.table_trueprice);
		$("#form_customerid").val(selected.table_customer.customerid);
		$("#form_customername").val(selected.table_customer.customername);
		
		$("#form_attribute").val(selected.table_attribute);
		
		//$("#formorder").load("ajax.php?act=orderinfo2&orderid="+selected.table_id);  ??
		$("#formWindow").window('setTitle','编辑订单');
		actionType = selected.table_id;
		$("#submit").unbind("click");
		$("#submit").bind("click",{action:"<{:U('edit')}>",table_id:selected.table_id},checkSubmit);
		$("#formWindow").window('open');
		$("#myLayout").layout('resize');
		
	}
	
 $("#orderchannel").combotree({
		width:200,
		panelHeight:500,
		treeWidth:200,
		treeHeight:600,
		//required:true,
		//missingMessage:'不能选择存在子级频道的父频道',
		//url:'ajax.php?act=channeltree3',
		//onSelect:showAdplace
		//onClick:showAdplace 	??
	});



	
	
}
function editAction2(){	//审核一个订单
	var selected = $('#mytable').datagrid('getSelected');
	if(!selected){
		$.messager.alert('错误消息','请先选择一个订单再审核！','error');
	}else if(selected.table_status=='1' ){
		$.messager.alert('错误消息','订单已经通过财务审核，不能再修改','error');
	}else if(selected.table_status=='2' ){ 
		$.messager.alert('错误消息','此订单尚未通过审核，不能进行取消操作！','error');
	}else{
		$.post( '<{:U("edit2")}>', { form_id : selected.table_id } ,function(data){
			if(data.status=='false'){
				$.messager.alert('错误消息',data.info,'error');
			}else{
				$.messager.alert('提示消息',data.info,'info',function(){
					$("#mytable").datagrid('reload');
				});
			}
		},"json");
	}
}
function editAction3(){	//取消审核一个订单
	var selected = $('#mytable').datagrid('getSelected');
	if(!selected){
		$.messager.alert('错误消息','请先选择一个订单再取消审核！','error');
	}else if(selected.table_status=='0' ){ 
		$.messager.alert('错误消息','此订单尚未通过审核，不能进行取消操作！','error');
	}else if(selected.table_status=='2' ){ 
		$.messager.alert('错误消息','此订单尚未通过审核，不能进行取消操作！','error');
	}else{
		$.post( '<{:U("edit3")}>' , { form_id : selected.table_id } ,function(data){
			if(data.status=='false'){
				$.messager.alert('错误消息',data.info,'error');
			}else{
				$.messager.alert('提示消息',data.info,'info',function(){
					$("#mytable").datagrid('reload');
				});
			}
		},"json");
	}
}

function editAction4(){	//延期
	var selected = $('#mytable').datagrid('getSelected');
	if(!selected){
		$.messager.alert('错误消息','请先选择一个订单再审核！','error');
	}else if(selected.table_status>=1){
		$.messager.alert('错误消息','此订单已经审核过！','error');
	}else{
		$.post( '<{:U("edit4")}>', { form_id : selected.table_id },function(data){
			if(data.status=='false'){
				$.messager.alert('错误消息',data.info,'error');
			}else{
				$.messager.alert('提示消息',data.info,'info',function(){
					$("#mytable").datagrid('reload');
				});
			}
		},"json");
	}
}
function editAction5(){	//  
	var selected = $('#mytable').datagrid('getSelected');
	if(!selected){
		$.messager.alert('错误消息','请先选择一个订单再取消审核！','error');
	}else if(selected.table_status>=1){
		$.messager.alert('错误消息','此订单已通过审核，不能进行取消操作！','error');
	}else{
		$.post( '<{:U("edit5")}>', { form_id : selected.table_id }, function(data){
			if(data.status=='false'){
				$.messager.alert('错误消息',data.info,'error');
			}else{
				$.messager.alert('提示消息',data.info,'info',function(){
					$("#mytable").datagrid('reload');
				});
			}
		},"json");
	}
}



function removeAction(){	//删除一个订单
	var selected = $('#mytable').datagrid('getSelected');
    /*
	var delBool = $.ajax({
		url: "<{:U('getdelauth')}>",
		async: false,
		type: "POST",
		data: { form_id : selected.table_id }
	}).responseText;
	
	delBool = parseInt(delBool);
    */
	if(!selected){
		$.messager.alert('错误消息','请先选择一个订单再删除！','error');
	}
	//else if(!delBool && selected.table_status >= 1){
	//	$.messager.alert('错误消息','此订单已经审核过，不能删除！','error');
	//}
	else if( selected.table_status >= 1){
		$.messager.alert('错误消息','此订单已经审核过，不能删除！','error');
	}
	else{
		$.messager.confirm('提示消息','确认删除？',function(r){
			if(r){
				$.post( "<{:U('remove')}>", { form_id : selected.table_id },function(data){
					if(data.status=='false'){
						$.messager.alert('错误消息',data.info,'error');
					}else{
						$.messager.alert('提示消息',data.info,'info',function(){
							$("#mytable").datagrid('reload');
						});
					}
				},"json");
			}
		});
	}
}


//#################选择客户系列函数##########################
function selectCustomer(){	//客户查询页面
	undoCustomer();
	searchCustomer();
	$("#searchCustomer").window('open');
	$("#customerLayout").layout('resize');
}
function searchCustomer(){	//客户查询程序
	var searchtitle = encodeURIComponent($.trim($("#customertitle").val()));
	var searchaddress = encodeURIComponent($.trim($("#customeraddress").val()));
	var searchprovince = $("#customerprovince").val();
	var searchcontact = encodeURIComponent($.trim($("#customercontact").val()));
	var searchphone = encodeURIComponent($.trim($("#customerphone").val()));
	var searchtypeid = $("#customertypeid").val();
	 
	//$('#customerTable').datagrid({pageNumber:'1',pageSize:'10',url:'<{:U("customer")}>&noshowdel=1&searchtitle='+searchtitle+'&searchaddress='+searchaddress+'&searchprovince='+searchprovince+'&searchcontact='+searchcontact+'&searchphone='+searchphone+'&searchtypeid='+searchtypeid});
	 
	$('#customerTable').datagrid( {pageNumber:'1',pageSize:'10',url:'<{:U("customer")}>', queryParams : {
			page:'1',
			rows:'10',
			noshowdel:1,
			searchtitle:searchtitle,
			searchaddress: searchaddress,
			searchprovince : searchprovince,
			searchcontact : searchcontact,
			searchphone : searchphone,
			searchtypeid : searchtypeid
		} 
		});
		
}
function undoCustomer(){	//重置客户查询参数
	$("#customertitle").val('');
	$("#customeraddress").val('');
	$("#customerprovince").val('0');
	$("#customercontact").val('');
	$("#customerphone").val('');
	$("#customertypeid").val('0');
}



</script>
</head>
<body class="easyui-layout">
<div region="center" title="订单设置-&gt;订单管理">
<div class="easyui-layout" fit="true">
	<div region="north" border="false" style="height:70px;padding:2px;padding-left:5px;background-color:#DFE8F6;font-size:11px;color:#15428B;"><table><tr><td>标题：</td><td><input TYPE="text" NAME="searchtitle" id="searchtitle" style="width:150px;"></td><td>品牌：</td><td><select name="searchbrandid" id="searchbrandid" style="width:150px"><option value="0">──请选择──</option><option value="3">一汽-奥迪</option>,<option value="7">北京奔驰</option>,<option value="87">宾利</option>,<option value="21">东风本田</option>,<option value="22">东风标致</option>,<option value="11">比亚迪</option>,<option value="10">奔驰中国</option>,<option value="89">巴博斯</option>,<option value="8">北京汽车</option>,<option value="65">一汽奔腾</option>,<option value="5">宝马汽车</option>,<option value="6">保时捷</option>,<option value="80">本田中国</option>,<option value="31">广汽本田</option>,<option value="16">长安汽车</option>,<option value="17">长城汽车</option>,<option value="18">长丰汽车</option>,<option value="78">DS品牌</option>,<option value="27">东南汽车</option>,<option value="30">福建戴姆勒</option>,<option value="19">大发汽车</option>,<option value="57">上海大众</option>,<option value="66">一汽大众</option>,<option value="23">东风乘用车</option>,<option value="81">东风裕隆</option>,<option value="20">大众中国</option>,<option value="32">广汽丰田</option>,<option value="13">长安福特/福特中国</option>,<option value="29">菲亚特</option>,<option value="28">法拉利</option>,<option value="67">一汽丰田/丰田中国</option>,<option value="94">观致汽车</option>,<option value="33">广汽集团</option>,<option value="37">华泰汽车</option>,<option value="38">黄海汽车</option>,<option value="83">红旗</option>,<option value="36">华晨汽车</option>,<option value="34">哈飞</option>,<option value="35">海马汽车</option>,<option value="39">吉利汽车</option>,<option value="40">江淮汽车</option>,<option value="41">江铃汽车</option>,<option value="42">捷豹</option>,<option value="85">进口凯迪拉克</option>,<option value="44">克莱斯勒</option>,<option value="12">昌河铃木</option>,<option value="92">林肯</option>,<option value="93">路特斯</option>,<option value="73">重庆力帆</option>,<option value="50">路虎中国</option>,<option value="45">劳斯莱斯</option>,<option value="14">长安铃木</option>,<option value="49">柳汽</option>,<option value="48">铃木中国</option>,<option value="47">雷诺中国</option>,<option value="46">雷克萨斯</option>,<option value="4">MINI</option>,<option value="68">一汽马自达</option>,<option value="15">长安马自达</option>,<option value="60">上汽名爵</option>,<option value="82">进口马自达</option>,<option value="1">欧宝</option>,<option value="51">讴歌</option>,<option value="79">PSA中国</option>,<option value="26">东风悦达起亚</option>,<option value="54">青年汽车</option>,<option value="53">起亚中国</option>,<option value="52">奇瑞汽车</option>,<option value="24">东风日产</option>,<option value="61">上汽荣威</option>,<option value="69">郑州日产</option>,<option value="55">日产中国</option>,<option value="84">双龙汽车</option>,<option value="58">上海大众斯柯达</option>,<option value="86">广汽三菱</option>,<option value="56">三菱中国</option>,<option value="63">斯巴鲁中国</option>,<option value="88">进口斯柯达</option>,<option value="59">上海通用</option>,<option value="62">上汽五菱</option>,<option value="2">沃尔沃</option>,<option value="25">东风雪铁龙</option>,<option value="43">进口现代</option>,<option value="9">北京现代</option>,<option value="91">西雅特</option>,<option value="64">天津一汽</option>,<option value="72">众泰汽车</option>,<option value="71">中兴汽车</option>,<option value="90">综合经销商店</option>,<option value="76">其他+非车</option>,<option value="75">GPS+音响</option>,<option value="74">轮胎+机油</option></select></td><td>状态：</td><td>
	<select name="searchstatus" id="searchstatus" style="width:100px">

	</select></td><td><a class="easyui-linkbutton" icon="icon-search" onclick="searchres();">搜索</a></td></tr><tr><td>编号：</td><td><input TYPE="text" NAME="searchcode" id="searchcode" style="width:150px;"></td><td>订单分类：</td><td><SELECT NAME="searchtypeid" id="searchtypeid" style="width:150px"><option value="0">──请选择──</option><option value="1">大客-北区</option>,<option value="2">大客-东区</option>,<option value="3">大客-南区</option>,<option value="4">用品+非车</option>,<option value="5">市场服务</option>,<option value="7">渠道-华北</option>,<option value="6">渠道-华南</option>,<option value="8">渠道-华东</option>,<option value="11">渠道-华中</option>,<option value="10">渠道-东北</option>,<option value="9">渠道-华西</option></SELECT></td><td>客户：</td><td><input TYPE="text" NAME="searchkh" id="searchkh" style="width:100px;"></td><td><a class="easyui-linkbutton" icon="icon-undo" onclick="undo();">重置</a></td><td><a class="easyui-linkbutton" icon="icon-save" onclick="excel('1');">全部导出</a></td><td><a class="easyui-linkbutton" icon="icon-save" onclick="excel('2');">本页导出</a></td></tr></table></div>
	<div region="center" border="true"><table id="mytable"></table></div>
</div>
</div>
 
<div id="formWindow" class="easyui-window" title="新增订单" minimizable="false" collapsible="false" maximizable="false" closed="true" modal="true" style="width:650px;height:500px;padding:0px;">
	<div class="easyui-layout" fit="true" id="myLayout">
		<div region="center" border="false">
		<form id="myForm" method="post" style="width:600px;height:400px;">
			<input type="hidden" id="form_id" name="form_id" value="">
			<input TYPE="hidden" NAME="form_customerid" id="form_customerid" />
			<input type="hidden" name="form_contactsid" id="form_contactsid" />
			<div class="easyui-tabs" fit="true" plain="true" border="false">
			<div title="基本信息" style="padding:15px;">
			<table>
				<tr><td>订单标题：</td><td><input class="easyui-validatebox" required="true" missingMessage="订单标题不能为空" TYPE="text" NAME="form_title" id="form_title" style="width:250px"></td></tr>
				<tr><td>品牌：</td><td><SELECT   class="easyui-validatebox"   required="true"  missingMessage=" 不能为空" NAME="form_brandid" id="form_brandid" style="width:250px"><option value="0">────请选择品牌────</option><option value="3">一汽-奥迪</option>,<option value="7">北京奔驰</option>,<option value="87">宾利</option>,<option value="21">东风本田</option>,<option value="22">东风标致</option>,<option value="11">比亚迪</option>,<option value="10">奔驰中国</option>,<option value="89">巴博斯</option>,<option value="8">北京汽车</option>,<option value="65">一汽奔腾</option>,<option value="5">宝马汽车</option>,<option value="6">保时捷</option>,<option value="80">本田中国</option>,<option value="31">广汽本田</option>,<option value="16">长安汽车</option>,<option value="17">长城汽车</option>,<option value="18">长丰汽车</option>,<option value="78">DS品牌</option>,<option value="27">东南汽车</option>,<option value="30">福建戴姆勒</option>,<option value="19">大发汽车</option>,<option value="57">上海大众</option>,<option value="66">一汽大众</option>,<option value="23">东风乘用车</option>,<option value="81">东风裕隆</option>,<option value="20">大众中国</option>,<option value="32">广汽丰田</option>,<option value="13">长安福特/福特中国</option>,<option value="29">菲亚特</option>,<option value="28">法拉利</option>,<option value="67">一汽丰田/丰田中国</option>,<option value="94">观致汽车</option>,<option value="33">广汽集团</option>,<option value="37">华泰汽车</option>,<option value="38">黄海汽车</option>,<option value="83">红旗</option>,<option value="36">华晨汽车</option>,<option value="34">哈飞</option>,<option value="35">海马汽车</option>,<option value="39">吉利汽车</option>,<option value="40">江淮汽车</option>,<option value="41">江铃汽车</option>,<option value="42">捷豹</option>,<option value="85">进口凯迪拉克</option>,<option value="44">克莱斯勒</option>,<option value="12">昌河铃木</option>,<option value="92">林肯</option>,<option value="93">路特斯</option>,<option value="73">重庆力帆</option>,<option value="50">路虎中国</option>,<option value="45">劳斯莱斯</option>,<option value="14">长安铃木</option>,<option value="49">柳汽</option>,<option value="48">铃木中国</option>,<option value="47">雷诺中国</option>,<option value="46">雷克萨斯</option>,<option value="4">MINI</option>,<option value="68">一汽马自达</option>,<option value="15">长安马自达</option>,<option value="60">上汽名爵</option>,<option value="82">进口马自达</option>,<option value="1">欧宝</option>,<option value="51">讴歌</option>,<option value="79">PSA中国</option>,<option value="26">东风悦达起亚</option>,<option value="54">青年汽车</option>,<option value="53">起亚中国</option>,<option value="52">奇瑞汽车</option>,<option value="24">东风日产</option>,<option value="61">上汽荣威</option>,<option value="69">郑州日产</option>,<option value="55">日产中国</option>,<option value="84">双龙汽车</option>,<option value="58">上海大众斯柯达</option>,<option value="86">广汽三菱</option>,<option value="56">三菱中国</option>,<option value="63">斯巴鲁中国</option>,<option value="88">进口斯柯达</option>,<option value="59">上海通用</option>,<option value="62">上汽五菱</option>,<option value="2">沃尔沃</option>,<option value="25">东风雪铁龙</option>,<option value="43">进口现代</option>,<option value="9">北京现代</option>,<option value="91">西雅特</option>,<option value="64">天津一汽</option>,<option value="72">众泰汽车</option>,<option value="71">中兴汽车</option>,<option value="90">综合经销商店</option>,<option value="76">其他+非车</option>,<option value="75">GPS+音响</option>,<option value="74">轮胎+机油</option></SELECT></td></tr>
				<tr><td>订单分类：</td><td><SELECT   class="easyui-validatebox"   required="true"  missingMessage=" 不能为空" NAME="form_typeid" id="form_typeid" style="width:250px"><option value="0">────请选择订单分类────</option><{:$ordertypeHTML}></SELECT></td></tr>
				<tr><td>销售：</td><td><SELECT  class="easyui-validatebox"   required="true"  missingMessage=" 不能为空" NAME="form_usernameorder" id="form_usernameorder" style="width:250px"><option value="0">────请选择销售────</option><{:$xiaoshouHTML}></SELECT></td></tr>
				<tr><td>客户：</td><td><input   class="easyui-validatebox"     TYPE="text" NAME="form_customername" id="form_customername" style="width:250px" readonly onclick="selectCustomer();"></td></tr>
				<!--<tr><td>联系人：</td><td><input type="text" class="easyui-validatebox" name="form_contacts" id="form_contacts" style="width:250px" onclick="selectContacts();" /></td></tr>-->
				<tr><td>订单价格：</td><td><input TYPE="text" NAME="form_trueprice" id="form_trueprice" style="width:200px" class="easyui-numberbox" required="true" precision="2">元</td></tr>
			
			<tr><td>订单属性：</td><td><SELECT   class="easyui-validatebox"    NAME="form_attribute" id="form_attribute" style="width:250px"   >
			<option value="0">─正常──</option>			<option value="1">─补量─</option>
			<option value="2">─软性配合─</option>
			<option value="3">─市场资源互换─</option>
			<option value="4">─正常（打包）─</option>
			<option value="5">─剩余资源─</option>
			<option value="6">─社区配合─</option>
            <option value="7">─其他─</option>
            <option value="8">─框架资源─</option>
            <option value="9">─渠道会员─</option>
            <option value="10">─渠道硬广─</option>
            <option value="11">─渠道会员+硬广─</option>
            <option value="12">─代理─</option>
			
                            
			</SELECT></td></tr>
			</table>
			</div>
			<div title="排期规则" style="padding:5px;"><div><table id="formorder" border='1' bgcolor=#DFE8F6 cellspacing=0 cellpadding=0 style='color:#333333;font-size:10pt;'></table></div><div><a class="easyui-linkbutton" href="javascript:createNewOrder()" >新增一条排期规则</a></div></div>
			</div>
		</form>
		</div>
		<div region="south" border="false" style="text-align:right;height:30px;line-height:30px;">
			<a class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" id="submit">确定</a>
			<a class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)" onclick="closeForm()">取消</a>
		</div>
	</div>
</div>

<div id="searchCustomer" class="easyui-window" title="查找客户" minimizable="false" collapsible="false" maximizable="false" closed="true" modal="true" style="width:600px;height:550px;">
	<div class="easyui-layout" fit="true" id="customerLayout">
		<div region="north" border="false" style="height:70px;padding:2px;padding-left:5px;background-color:#DFE8F6;font-size:11px;color:#15428B;">
		<table>
			<tr><td>名称/简称</td><td><input TYPE="text" NAME="customertitle" id="customertitle" style="width:80px;"></td><td>地址</td><td><input TYPE="text" NAME="customeraddress" id="customeraddress" style="width:80px;"></td><td>省份</td><td><SELECT NAME="customerprovince" id="customerprovince" style="width:80px"><option value="0">─请选择─</option><?=$provinceSelectHtml?></SELECT></td><td><a class="easyui-linkbutton" icon="icon-search" onclick="searchCustomer();">搜索</a></td></tr>
			<tr><td>联系人</td><td><input TYPE="text" NAME="customercontact" id="customercontact" style="width:80px;"></td><td>电话/手机/Email</td><td><input TYPE="text" NAME="customerphone" id="customerphone" style="width:80px;"></td><td>类型</td><td><SELECT NAME="customertypeid" id="customertypeid" style="width:80px"><option value="0">─请选择─</option><option value="1">直客</option>,<option value="2">代理公司</option></SELECT></td><td><a class="easyui-linkbutton" icon="icon-undo" onclick="undoCustomer();">重置</a></td></tr></table></div>
		<div region="center" border="true"><table id="customerTable"></table></div>
	</div>
</div>
 
 
 
 <div id="searchCustomer" class="easyui-window" title="查找客户" minimizable="false" collapsible="false" maximizable="false" closed="true" modal="true" style="width:600px;height:550px;">
	<div class="easyui-layout" fit="true" id="customerLayout">
		<div region="north" border="false" style="height:70px;padding:2px;padding-left:5px;background-color:#DFE8F6;font-size:11px;color:#15428B;"><table><tr><td>名称/简称</td><td><input TYPE="text" NAME="customertitle" id="customertitle" style="width:80px;"></td><td>地址</td><td><input TYPE="text" NAME="customeraddress" id="customeraddress" style="width:80px;"></td><td>省份</td><td><SELECT NAME="customerprovince" id="customerprovince" style="width:80px"><option value="0">─请选择─</option><?=$provinceSelectHtml?></SELECT></td><td><a class="easyui-linkbutton" icon="icon-search" onclick="searchCustomer();">搜索</a></td></tr><tr><td>联系人</td><td><input TYPE="text" NAME="customercontact" id="customercontact" style="width:80px;"></td><td>电话/手机/Email</td><td><input TYPE="text" NAME="customerphone" id="customerphone" style="width:80px;"></td><td>类型</td><td><SELECT NAME="customertypeid" id="customertypeid" style="width:80px"><option value="0">─请选择─</option><?=$customertypeSelectHtml?></SELECT></td><td><a class="easyui-linkbutton" icon="icon-undo" onclick="undoCustomer();">重置</a></td></tr></table></div>
		<div region="center" border="true"><table id="customerTable"></table></div>
	</div>
</div>


</body>
</html>